<template>
  <div v-bind="$attrs">
    <h3>ComC 组件</h3>
    <p>这是一个段落</p>
  </div>

  <div v-bind="$attrs">
    <h4>xxxx</h4>
  </div>
</template>

<script setup>
import { useAttrs, watchEffect } from 'vue'

defineOptions({
  // 禁用 Attributes 的继承
  inheritAttrs: true
})

const attrs = useAttrs()
console.log(attrs)

watchEffect(() => {
  console.log(attrs.id)
})
</script>
